#ifndef COMPILER_DEFS_H
#define COMPILER_DEFS_H

#include <wx/string.h>
#include <wx/list.h>
class M_Code_Project;
class ProjectBuildTarget;

struct CompilerCommand {
  CompilerCommand( const wxString& cmd, const wxString& msg, M_Code_Project* prj, ProjectBuildTarget* tgt, bool is_run = false )
    : command( cmd ), message( msg ), project( prj ), target( tgt ), isRun( is_run ), mustWait( false ), isLink( false ) {}
  CompilerCommand( const CompilerCommand& rhs )
    : command( rhs.command ), message( rhs.message ), project( rhs.project ), target( rhs.target ), isRun( rhs.isRun ), mustWait( rhs.mustWait ), isLink( rhs.isLink ) {}
  wxString command;
  wxString message;
  wxString dir;
  M_Code_Project* project;
  ProjectBuildTarget* target;
  bool isRun;
  bool mustWait;
  bool isLink;
};
WX_DECLARE_LIST( CompilerCommand, CompilerCommands );

class CompilerQueue {
  public:
    CompilerQueue();
    ~CompilerQueue();
    void Clear();
    size_t GetCount() const;
    bool LastCommandWasRun() const;
    void Add( CompilerCommand* cmd );
    void Add( CompilerQueue* queue );
    CompilerCommand* Next();
    CompilerCommand* Peek();
  protected:
    CompilerCommands m_Commands;
    bool m_LastWasRun;
};

#endif
